<template>
	<com-action-sheet
	:visible="visible"
	:title="title"
	:data="actions"
	:bg-color="skinColor.color_bg_2"
	:title-color="skinColor.color_1"
	:text-color="skinColor.color_2"
	:border-color="skinColor.color_gap_1"
	:cancel-color="skinColor.color_1"
	cancel-show
	@hide="hide"
	@confirm="handleActionConfirm"></com-action-sheet>
</template>

<script>
	import appMixin from '@/assets/mixin/app.js'
	export default {
		mixins: [appMixin],
		data () {
			return {
				title: '',
				visible: false,
				success: null,
				fail: null,
				actions: []
			}
		},
		methods: {
			hide () {
				this.visible = false,
				this.success = null,
				this.fail = null
			},
			select ({title, actions, success, fail}) {
				this.title = title
				this.actions = actions
				this.visible = true
				this.success = success,
				this.fail = fail
			},
			handleActionConfirm (e) {
				this.success && this.success(e)
				this.hide()
			}
		}
	}
</script>

<style>
</style>